import { listAllTableData, findDataById, DeleteDataById, queryAllExportData, pushNation } from '@/services/formalDatabaseApi';

export default {
    namespace: 'formalDatabase',

    state: {

    },

    effects: {

        /**
            * 分页
            * @param payload
            * @param call
            * @param put
            * @returns {Generator<*, *, *>}
            */
        *listAllTableData({ payload }, { call, put }) {
            const response = yield call(listAllTableData, payload);
            return response;
        },


        /**
     * 详情
    * */
        *findDataById({ payload }, { call, put }) {
            const response = yield call(findDataById, payload);
            return response;
        },

        /**
          * 回退
          * @param payload
          * @param call
          * @param put
          * @returns {Generator<*, *, *>}
          */
        *DeleteDataById({ payload }, { call, put }) {
            const response = yield call(DeleteDataById, payload);
            return response;
        },

        /**
   * 点击导出列表信息
   * @param payload
   * @param call
   * @param put
   * @returns {Generator<*, *, *>}
   */
        *queryAllExportData({ payload }, { call, put }) {
            const response = yield call(queryAllExportData, payload);
            return response;
        },

        /**
         * 数据推送至国家平台
        * @param payload
        * @param call
         * @param put
        * @returns {Generator<*, *, *>}
         */

        *pushNation({ payload }, { call, put }) {
            const response = yield call(pushNation, payload);
            return response;
        },
    },

    reducers: {

    },
};
